<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');?>
<script type="text/javascript">
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
	})
//-->
</script>

<form name="myform" id="myform" action="?m=ushop&c=ushop&a=setting" method="post">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',5,1);"><?php echo L('base_setting')?></li>
<li id="tab_setting_2" onclick="SwapTab('setting','on','',5,2);"><?php echo L('seo_setting')?></li>
<li id="tab_setting_3" onclick="SwapTab('setting','on','',5,3);"><?php echo L('sale_setting')?></li>
<li id="tab_setting_4" onclick="SwapTab('setting','on','',5,4);"><?php echo L('sms_setting')?></li>
<li id="tab_setting_5" onclick="SwapTab('setting','on','',5,5);"><?php echo L('email_setting')?></li>
</ul>
<div id="div_setting_1" class="contentList pad-10">

<table width="100%" class="table_form ">
	  <tr>
        <th width="200"><strong><?php echo L('is_domain')?></strong>：</th>
        <td>
			<input type='radio' name='setting[isdomain]' value='1' <?php if ($setting['isdomain']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[isdomain]' value='0' <?php if (!$setting['isdomain']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
      </tr>
      <tr>
    <th width="200"><strong><?php echo L('site_domain','','admin')?>：</strong></th>
    <td class="y-bg"><input type="text" class="input-text" name="setting[domain]" id="domain"  size="30" value="<?php echo $setting['domain']?>" /> <?php echo L('note_domain')?></td>
 	 </tr>
	<tr>
    <th width="200"><strong><?php echo L('site_dirname','','admin')?>：</strong></th>
    <td class="y-bg"><input type="text" class="input-text" name="setting[dirname]" id="dirname" size="30" value="<?php echo $setting['dirname']?>" /><?php echo L('note_dirname')?></td>
  </tr>
  <tr>
        <th width="200"><strong><?php echo L('is_pay')?></strong>：</th>
        <td>
			<input type='radio' name='setting[isbusiness]' value='1' <?php if ($setting['isbusiness']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[isbusiness]' value='0' <?php if (!$setting['isbusiness']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>
   <tr>
   <th width="200"><strong><?php echo L('market_price_rate')?></strong>：</th>
     <td>
		<input type="text" class="input-text" name="setting[market_price_rate]" id="market_price_rate"  size="30"  value="<?php if($setting['market_price_rate']){echo $setting['market_price_rate'] ;}else {echo '1.2';}?>" /> 
	</td>
   </tr> 
    <th width="200"><strong><?php echo L('UPNP')?></strong>：</th>
     <td>
		<input type="text" class="input-text" name="setting[UPNP]" id="UPNP"  size="30" value="<?php if($setting['UPNP']){echo $setting['UPNP'] ;}else {echo 'PNo.';}?>" /> 
	</td>
   </tr>  
    <th width="200"><strong><?php echo L('Default inventory')?></strong>：</th>
     <td>
        <input type="text" class="input-text" name="setting[defaultinventory]" id="defaultinventory"  size="30" value="<?php if($setting['defaultinventory']){echo $setting['defaultinventory'] ;}else {echo '10';}?>" /> 
	</td>
   </tr> 
   <tr>
   <th width="200"><strong><?php echo L('use_integral')?></strong>：</th>
     <td>
			<input type='radio' name='setting[use_integral]' value='1' <?php if ($setting['use_integral']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[use_integral]' value='0' <?php if (!$setting['use_integral']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
   <tr>
   <th width="200"><strong><?php echo L('use_bonus')?></strong>：</th>
     <td>
			<input type='radio' name='setting[use_bonus]' value='1' <?php if ($setting['use_bonus']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[use_bonus]' value='0' <?php if (!$setting['use_bonus']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
    <tr>
   <th width="200"><strong><?php echo L('use_surplus')?></strong>：</th>
     <td>
			<input type='radio' name='setting[use_surplus]' value='1' <?php if ($setting['use_surplus']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[use_surplus]' value='0' <?php if (!$setting['use_surplus']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
    <tr>
   <th width="200"><strong><?php echo L('use_how_oos')?></strong>：</th>
     <td>
			<input type='radio' name='setting[use_how_oos]' value='1' <?php if ($setting['use_how_oos']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[use_how_oos]' value='0' <?php if (!$setting['use_how_oos']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('stock_dec_time')?></strong>：</th>
     <td>
			<input type='radio' name='setting[stock_dec_time]' value='1' <?php if ($setting['use_how_oos']) {?>checked<?php }?>> 下订单时&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[stock_dec_time]' value='0' <?php if (!$setting['use_how_oos']) {?>checked<?php }?>>  发货后
		</td>
   </tr>  
   <th width="200"><strong><?php echo L('guest_to_buy')?></strong>：</th>
     <td>
			<input type='radio' name='setting[guest_to_buy]' value='1' <?php if ($setting['guest_to_buy']) {?>checked<?php }?>> <?php echo L('yes')?>
		  	<input type='radio' name='setting[guest_to_buy]' value='0' <?php if (!$setting['guest_to_buy']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
		<tr>
      <th width="200"><strong><?php echo L('ushop_title')?></strong>：<br><?php echo L('title_for_search_engines')?></th>
      <td><input type="text" size="30" name="setting[seo_title]" value="<?php echo $setting['seo_title']?>" id="seo_title" class="input-text"></td>
    </tr>
	<tr>
      <th><strong><?php echo L('ushop_keywords')?></strong>：<br><?php echo L('keyword_for_search_engines')?></th>
      <td><textarea name='setting[seo_keywords]' cols='60' rows='2' id='seo_keywords'><?php echo $setting['seo_keywords']?></textarea></td>
    </tr>
	<tr>
      <th><strong><?php echo L('ushop_description')?></strong>：<br><?php echo L('description_for_search_engines')?></th>
      <td><textarea name='setting[seo_description]' cols='60' rows='2' id='seo_description'><?php echo $setting['seo_description']?></textarea></td>
    </tr>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
<tr><td><a href="?m=member&c=member_group&a=manage" style="color:red" title="点击前往管理会员组"><strong>管理会员组</strong></a></td><td>请直接输入比例值，如 ”1.2” 则表示： 【当前会员组价格】 =  【商品价格】 * 1.2</td></tr>
		<?php
			$group_cache = getcache('grouplist','member');
			foreach($group_cache as $_key=>$_value) {
				
				if(in_array($_key,array('1','7','8'))){
					
					}else{
			?>
		  		<tr>
				  <td width="120"><?php echo $_value['name'];?></td>
				  <td align="left"><input type="text" class="input-text" name="setting[groupprice][<?php echo $_value['groupid'];?>]"   value="<?php echo $setting['groupprice'][$_value['groupid']]?>" ></td>
			  </tr>
			<?php }
			 }?>
</table>
</div>
<div id="div_setting_4" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
    <th width="200"><strong><?php echo L('server_phone')?></strong>：</th>
     <td>
        <input type="text" class="input-text" name="setting[server_phone]" id="server_phone"  size="30" value="<?php if($setting['server_phone']){echo $setting['server_phone'] ;}else {echo '13777795925';}?>" />   * 设置客服短信后，将会收到以下设置的短信的短信提醒,为空则不会收到
	</td>
   </tr> 
   <tr>
 

   <th width="200"><strong><?php echo L('order_ture')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_ture_sms]' value='1' <?php if ($setting['order_ture_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_ture_sms]' value='0' <?php if (!$setting['order_ture_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
   <tr>
   <th width="200"><strong><?php echo L('order_pay_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_pay_sms]' value='1' <?php if ($setting['order_pay_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_pay_sms]' value='0' <?php if (!$setting['order_pay_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
    <tr>
   <th width="200"><strong><?php echo L('order_unpay_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_unpay_sms]' value='1' <?php if ($setting['order_unpay_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_unpay_sms]' value='0' <?php if (!$setting['order_unpay_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>
    <tr>
   <th width="200"><strong><?php echo L('order_ship_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_ship_sms]' value='1' <?php if ($setting['order_ship_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_ship_sms]' value='0' <?php if (!$setting['order_ship_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('order_unship_note')?></strong>：</th>
      <td>
			<input type='radio' name='setting[order_unship_sms]' value='1' <?php if ($setting['order_unship_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_unship_sms]' value='0' <?php if (!$setting['order_unship_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
   <th width="200"><strong><?php echo L('send_ship_email')?></strong>：</th>
      <td>
			<input type='radio' name='setting[order_send_sms]' value='1' <?php if ($setting['order_send_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_send_sms]' value='0' <?php if (!$setting['order_send_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('order_receive_note')?></strong>：</th>
      <td>
			<input type='radio' name='setting[order_receive_sms]' value='1' <?php if ($setting['order_receive_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_receive_sms]' value='0' <?php if (!$setting['order_receive_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>    
   <th width="200"><strong><?php echo L('order_cancel_note')?></strong>：</th>
      <td>
			<input type='radio' name='setting[order_cancel_sms]' value='1' <?php if ($setting['order_cancel_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_cancel_sms]' value='0' <?php if (!$setting['order_cancel_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('order_return_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_return_sms]' value='1' <?php if ($setting['order_return_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_return_sms]' value='0' <?php if (!$setting['order_return_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('order_invalid_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_invalid_sms]' value='1' <?php if ($setting['order_invalid_sms']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_invalid_sms]' value='0' <?php if (!$setting['order_invalid_sms']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>  
</table>
</div>
<div id="div_setting_5" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
   <th width="200"><strong><?php echo L('order_ture')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_ture_email]' value='1' <?php if ($setting['order_ture_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_ture_email]' value='0' <?php if (!$setting['order_ture_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
   <tr>
   <th width="200"><strong><?php echo L('order_pay_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_pay_email]' value='1' <?php if ($setting['order_pay_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_pay_email]' value='0' <?php if (!$setting['order_pay_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
    <tr>
   <th width="200"><strong><?php echo L('order_unpay_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_unpay_email]' value='1' <?php if ($setting['order_unpay_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_unpay_email]' value='0' <?php if (!$setting['order_unpay_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>
    <tr>
   <th width="200"><strong><?php echo L('order_ship_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_ship_email]' value='1' <?php if ($setting['order_ship_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_ship_email]' value='0' <?php if (!$setting['order_ship_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('order_unship_note')?></strong>：</th>
      <td>
			<input type='radio' name='setting[order_unship_email]' value='1' <?php if ($setting['order_unship_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_unship_email]' value='0' <?php if (!$setting['order_unship_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 
   <th width="200"><strong><?php echo L('send_ship_email')?></strong>：</th>
      <td>
			<input type='radio' name='setting[order_send_email]' value='1' <?php if ($setting['order_send_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_send_email]' value='0' <?php if (!$setting['order_send_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('order_receive_note')?></strong>：</th>
      <td>
			<input type='radio' name='setting[order_receive_email]' value='1' <?php if ($setting['order_receive_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_receive_email]' value='0' <?php if (!$setting['order_receive_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>    
   <th width="200"><strong><?php echo L('order_cancel_note')?></strong>：</th>
      <td>
			<input type='radio' name='setting[order_cancel_email]' value='1' <?php if ($setting['order_cancel_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_cancel_email]' value='0' <?php if (!$setting['order_cancel_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('order_return_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_return_email]' value='1' <?php if ($setting['order_return_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_return_email]' value='0' <?php if (!$setting['order_return_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr>   
   <th width="200"><strong><?php echo L('order_invalid_note')?></strong>：</th>
     <td>
			<input type='radio' name='setting[order_invalid_email]' value='1' <?php if ($setting['order_invalid_email']) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
		  	<input type='radio' name='setting[order_invalid_email]' value='0' <?php if (!$setting['order_invalid_email']) {?>checked<?php }?>>  <?php echo L('no')?>
		</td>
   </tr> 

    
</table>
 </div>




 <div class="bk15"></div>
    <input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">

</form>
</div>

</div>
<!--table_form_off-->
</div>

<script language="JavaScript">
<!--
	window.top.$('#display_center_id').css('display','none');
	function SwapTab(name,cls_show,cls_hide,cnt,cur){
		for(i=1;i<=cnt;i++){
			if(i==cur){
				 $('#div_'+name+'_'+i).show();
				 $('#tab_'+name+'_'+i).attr('class',cls_show);
			}else{
				 $('#div_'+name+'_'+i).hide();
				 $('#tab_'+name+'_'+i).attr('class',cls_hide);
			}
		}
	}
	<?php if($modelid) echo "change_tpl($modelid)";?>

//-->
</script>